<%-- 
    Document   : editHomePageImage
    Created on : Jun 22, 2012, 3:20:11 PM
    Author     : Owner
--%>

<%@include file="/jsp/adminTop.jsp" %>

<html>
    <head>
        <title>Update Home Page Ads</title>
    </head>
    <body>
        <div class="clear"></div>
        <table cellspacing="5px" width="100%" align="center">
            <tr>
                <td>
                    <table cellspacing="5px" width="100%" align="center">
                        <tr>
                            <td style="vertical-align: top;" width="20%">
                                <%@include file="/jsp/right.jsp" %></td>
                            <td>                &nbsp;            </td>
                            <td style="vertical-align: top;" width="80%">
                                <div class="page-title"><h1>Home Page Images</h1></div>
                                <table align="center" border="1" cellspacing="10px" width="100%">
                                    <tr>
                                        <td>
                                            <table align="center" border="1" cellspacing="10px" width="100%">
                                                <tr>
                                                    <td><h2>Edit Images</h2></td>
                                                    <td>[<a href="./admin.do?action=showManageHomePageImage">Add Image</a> ]</td>
                                                </tr>
                                                <tr>
                                                    <td colspan="2">
                                                        <html:form action="/admin" method="post" enctype="multipart/form-data">
                                                            <logic:present name="imageDetail" scope="request">
                                                                <table align="center" border="1" cellspacing="10px" width="100%">
                                                                    <tr>
                                                                        <td>Image Id:</td>
                                                                        <td><bean:write name="imageDetail" property="imageId"/>
                                                                            <html:hidden name="imageDetail" property="imageId"/></td>
                                                                    </tr>
                                                                    <tr>
                                                                        <td>Image Alt Name:</td>
                                                                        <td><html:text name="imageDetail" property="imageName"/></td>
                                                                    </tr>
                                                                    <tr>
                                                                        <td>Image</td>
                                                                        <td>
                                                                            <html:file name="imageDetail" property="homePageImage" accept="image/*" />
                                                                            <br/>
                                                                            <html:hidden name="imageDetail" property="homePageImageName"/>
                                                                            <a href="images/<bean:write name="imageDetail" property="homePageImageName"/>">
                                                                                <bean:write name="imageDetail" property="homePageImageName"/></a>
                                                                        </td>
                                                                    </tr>
                                                                    <tr>
                                                                        <td>Details</td>
                                                                        <td><html:textarea name="imageDetail" property="imageDetail"/></td>
                                                                    </tr>
                                                                    <tr>
                                                                        <td colspan="2">
                                                                            <div id="errdividimage" >
                                                                                <span id="errspanidimage"></span>
                                                                                <html:errors property="errHPImage"/>
                                                                            </div>
                                                                        </td>
                                                                    </tr>
                                                                    <tr>
                                                                        <td colspan="2"><a onclick="javascript:return validateHomePageImage('./admin.do?action=updateHomePageImage','adminBean')">
                                                                                <img src="images/update.png" onmouseout="src='images/update.png'" onmouseover="src='images/update-hover.png'" alt="Update" /></a></td>
                                                                    </tr>
                                                                </table>
                                                            </logic:present>
                                                        </html:form>
                                                    </td>
                                                </tr>
                                            </table>
                                            <hr/>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <table align="center" border="1" cellspacing="10px" width="100%">
                                                <colgroup>
                                                    <col width="5%">
                                                    <col width="20%">
                                                    <col width="20%">
                                                    <col width="35%">
                                                    <col width="20">
                                                </colgroup>
                                                <tr>
                                                    <td><strong>ID</strong></td>
                                                    <td><strong>Image Alt Name</strong></td>
                                                    <td><strong>Image</strong></td>
                                                    <td><strong>Details</strong></td>
                                                    <td><strong>Delete</strong></td>
                                                </tr>
                                                <logic:notPresent name="homePageImageList" scope="request">
                                                    <tr>
                                                        <td colspan="5"> No records Found </td>
                                                    </tr>
                                                </logic:notPresent>
                                                <logic:present name = "homePageImageList" scope="request">
                                                    <logic:iterate id="imagesList" name="homePageImageList" scope="request">
                                                        <tr>
                                                            <td><bean:write name="imagesList" property="imageId"/></td>
                                                            <td><bean:write name="imagesList" property="imageName"/></td>
                                                            <td><a href="images/<bean:write name="imagesList" property="homePageImageName"/>">
                                                                    <bean:write name="imagesList" property="homePageImageName"/></a></td>
                                                                    <%--onclick="javascript:modalWin('<bean:write name="imagesList" property="homePageImageName"/>'); return false;"--%>
                                                            <td><bean:write name="imagesList" property="imageDetail"/></td>
                                                            <td>[<a href="./admin.do?action=deleteImage&imageId=<bean:write name="imagesList" property="imageId"/>" >Delete</a> ]</td>
                                                        </tr>
                                                    </logic:iterate>
                                                </logic:present>
                                            </table>
                                        </td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
            <tr>
                <td><%@include file="/jsp/footer.jsp" %></td>
            </tr>
        </table>
    </body>
</html>
